<%@ page import="java.util.Map"%>
<html>
<head>
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
	pageEncoding="ISO-8859-1"%>
<title>Score Report</title>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<meta http-equiv="Expires" content="0">
<meta http-equiv="Pragma" content="no-cache">
</head>
<%@include file="../include/CrystalReportHelper.jsp"%>
<body>
	<%! private String reportName;
	    private String reportType;%> 
	<%   try{
			Map map = (Map)session.getAttribute("reportParam");
			reportType = map.get("reportType").toString();
			if("1".equals(reportType)){
				reportName = "ReportScoreBatch.rpt";
				ReportClientDocument clientDoc = getClientDocument(reportName);
				System.out.println(map.get("batchParam").toString());
				try{
					setDocParameter(0, map.get("batchParam").toString(), clientDoc);
					viewReport(clientDoc, request, response, session);
				}catch(Exception e){
					e.printStackTrace();
				}finally{
					clientDoc.close();
					clientDoc.dispose();
				}
			}else if("2".equals(reportType)){
				reportName = "ReportScoreTrainee.rpt";
				ReportClientDocument clientDoc = getClientDocument(reportName);
				try{
					setDocParameter(0, map.get("traineeParam").toString(), clientDoc);
					viewReport(clientDoc, request, response, session);
				}catch(Exception e){
					e.printStackTrace();
				}finally{
					clientDoc.close();
					clientDoc.dispose();
				}
			}else if("3".equals(reportType)){
				reportName = "ReportScoreSubject.rpt";
				ReportClientDocument clientDoc = getClientDocument(reportName);
				try{
					setDocParameter(0, map.get("batchParam").toString(), clientDoc);
					setDocParameter(1, map.get("subjectParam").toString(), clientDoc);
					viewReport(clientDoc, request, response, session);
				}catch(Exception e){
					e.printStackTrace();
				}finally{
					clientDoc.close();
					clientDoc.dispose();
				}
			}
		}catch(Exception e){
			e.printStackTrace();
		}
	%>
</body>
</html>